/* 
  lookup(obj, 'a.b.c') => obj.a.b.c
*/
export default function lookup(dataObj, keyName) {
  if (keyName.indexOf('.') != -1 && !/\.+/.test(keyName)) {
    var keys = keyName.split('.')
    var temp = dataObj
    keys.forEach(k => {
      temp = temp[k]
    })
    return temp
  }

  return dataObj[keyName]
}
